home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 405_01 / flexpp / flexskel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-04  |  6.5 KB  |  304 lines

  1. /* A lexical scanner header generated by flex */
  2. /* MODIFIED FOR C++ CLASS BY Alain Coetmeur: coetmeur(at)icdc.fr */
  3. /* Note that (at) mean the 'at' symbol that I cannot write */
  4. /* because it is expanded to the class name */
  5. /* made at Informatique-CDC, Research&development department */
  6. /* company from the Caisse Des Depots et Consignations */
  7.  
  8.  
  9. /*********************************************/
  10. /* SYSTEM dependent declaration, includes... */
  11. /*********************************************/
  12. /* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
  13. #ifdef c_plusplus
  14. #ifndef __cplusplus
  15. #define __cplusplus
  16. #endif
  17. #endif
  18. #ifdef __cplusplus
  19. #ifndef YY_USE_PROTOS
  20. #define YY_USE_PROTOS
  21. #endif
  22. #ifndef YY_USE_CLASS
  23. #define YY_USE_CLASS
  24. #endif
  25. #else    /* ! __cplusplus */
  26. #ifdef __STDC__
  27. #ifdef __GNUC__
  28. #else
  29. #endif    /* __GNUC__ */
  30. #ifndef YY_USE_PROTOS
  31. #define YY_USE_PROTOS
  32. #endif
  33. #endif    /* __STDC__ */
  34. #endif    /* ! __cplusplus */
  35. /*********************************************/
  36. /* COMPILER DEPENDENT   MACROS               */
  37. /*********************************************/
  38. /* use prototypes in function declarations */
  39. #ifndef YY_PROTO
  40. #ifdef YY_USE_PROTOS
  41. #define YY_PROTO(proto) proto
  42. #else
  43. #define YY_PROTO(proto) ()
  44. #endif
  45. #endif
  46. #include <stdio.h>
  47.  
  48.  
  49.  
  50.  
  51. %% here is the declaration from section1 %header{ 
  52.  
  53.  
  54.  
  55. #ifndef YY_@_TEXT
  56. #define YY_@_TEXT yytext
  57. #endif
  58. #ifndef YY_@_LENG
  59. #define YY_@_LENG yyleng
  60. #endif
  61. #ifndef YY_@_IN
  62. #define YY_@_IN yyin
  63. #endif
  64. #ifndef YY_@_OUT
  65. #define YY_@_OUT yyout
  66. #endif
  67. #ifndef YY_@_LEX_RETURN
  68. #define YY_@_LEX_RETURN int
  69. #else
  70. #ifndef YY_@_LEX_DEFINED
  71. #define YY_@_LEX_DEFINED 
  72. #endif
  73. #endif
  74.  
  75. #ifndef YY_@_LEX
  76. #define YY_@_LEX yylex
  77. #else
  78. #ifndef YY_@_LEX_DEFINED
  79. #define YY_@_LEX_DEFINED 
  80. #endif
  81. #endif
  82.  
  83. #ifndef YY_@_LEX_PARAM
  84. #ifndef YY_USE_PROTOS
  85. #define YY_@_LEX_PARAM 
  86. #else
  87. #define YY_@_LEX_PARAM void
  88. #endif
  89. #else
  90. #ifndef YY_@_LEX_DEFINED
  91. #define YY_@_LEX_DEFINED 
  92. #endif
  93. #endif
  94.  
  95. #ifndef YY_@_LEX_PARAM_DEF
  96. #define YY_@_LEX_PARAM_DEF
  97. #else
  98. #ifndef YY_@_LEX_DEFINED
  99. #define YY_@_LEX_DEFINED 
  100. #endif
  101. #endif
  102.  
  103. #ifndef YY_@_RESTART
  104. #define YY_@_RESTART yyrestart
  105. #endif
  106. #ifndef YY_@_SWITCH_TO_BUFFER
  107. #define YY_@_SWITCH_TO_BUFFER yy_switch_to_buffer
  108. #endif
  109. #ifndef YY_@_LOAD_BUFFER_STATE
  110. #define YY_@_LOAD_BUFFER_STATE yy_load_buffer_state
  111. #endif
  112.  
  113. #ifndef YY_@_CREATE_BUFFER
  114. #define YY_@_CREATE_BUFFER yy_create_buffer
  115. #ifndef YY_USE_CLASS
  116. #ifndef yy_new_buffer
  117. #define yy_new_buffer yy_create_buffer
  118. #endif
  119. #endif
  120. #endif
  121. #ifndef YY_@_DELETE_BUFFER
  122. #define YY_@_DELETE_BUFFER yy_delete_buffer
  123. #endif
  124. #ifndef YY_@_INIT_BUFFER
  125. #define YY_@_INIT_BUFFER yy_init_buffer
  126. #endif
  127. #ifdef YY_@_FLEX_DEBUG
  128. #ifndef YY_@_DEBUG
  129. #define YY_@_DEBUG 1
  130. #endif
  131. #else
  132. #ifndef YY_@_DEBUG
  133. #define YY_@_DEBUG 0
  134. #endif
  135. #endif
  136.  
  137. #if YY_@_DEBUG != 0
  138. #ifndef YY_@_DEBUG_FLAG
  139. #define YY_@_DEBUG_FLAG yy_flex_debug
  140. #endif
  141. #ifndef YY_@_DEBUG_INIT
  142. #define YY_@_DEBUG_INIT 1
  143. #endif
  144. #endif
  145.  
  146.  
  147.  
  148.  
  149. #ifndef YY_USE_CLASS
  150. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  151.  
  152. extern void YY_@_RESTART YY_PROTO(( FILE *input_file ));
  153. extern void YY_@_SWITCH_TO_BUFFER YY_PROTO(( YY_BUFFER_STATE new_buffer ));
  154. extern void YY_@_LOAD_BUFFER_STATE YY_PROTO(( void ));
  155. extern YY_BUFFER_STATE YY_@_CREATE_BUFFER YY_PROTO(( FILE *file, int size ));
  156. extern void YY_@_DELETE_BUFFER YY_PROTO(( YY_BUFFER_STATE b ));
  157. extern void YY_@_INIT_BUFFER YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
  158.  
  159. #if YY_@_DEBUG != 0
  160. extern int YY_@_DEBUG_FLAG ;
  161. #endif
  162. extern YY_@_CHAR  *YY_@_TEXT;
  163. extern int YY_@_LENG;
  164. extern FILE *YY_@_IN, *YY_@_OUT;
  165. #ifdef YY_@_LEX_DEFINED
  166. extern YY_@_LEX_RETURN YY_@_LEX ( YY_@_LEX_PARAM )
  167. YY_@_LEX_PARAM_DEF
  168. #else
  169. #ifndef YY_DECL
  170. extern YY_@_LEX_RETURN YY_@_LEX ( YY_@_LEX_PARAM )
  171. YY_@_LEX_PARAM_DEF
  172. #else
  173. /* no declaration if oldstyle flex */
  174. #endif
  175. #endif
  176. #else
  177.  
  178. #ifndef YY_@_CLASS
  179. #define YY_@_CLASS @
  180. #endif
  181. #ifndef YY_@_ECHO
  182. #define YY_@_ECHO yy_echo
  183. #endif
  184. #ifdef YY_@_ECHO_PURE
  185. #define YY_@_ECHO_NOCODE
  186. #endif
  187. #ifndef YY_@_ECHO_CODE
  188. #define YY_@_ECHO_CODE fwrite( (char *) YY_@_TEXT, YY_@_LENG, 1, YY_@_OUT );
  189. #endif
  190. #ifndef YY_@_INPUT
  191. #define YY_@_INPUT yy_input
  192. #endif
  193. #ifdef YY_@_INPUT_PURE
  194. #define YY_@_INPUT_NOCODE
  195. #endif
  196. #ifndef YY_@_INPUT_CODE
  197. #define YY_@_INPUT_CODE return result= fread(  buffer, 1,max_size,YY_@_IN );
  198. #endif
  199. #ifdef YY_@_FATAL_ERROR_PURE
  200. #define YY_@_FATAL_ERRO_NOCODE
  201. #endif
  202. #ifndef YY_@_FATAL_ERROR
  203. #define YY_@_FATAL_ERROR yy_fatal_error
  204. #endif
  205. #ifndef YY_@_FATAL_ERROR_CODE
  206. #define YY_@_FATAL_ERROR_CODE fputs( msg, stderr );putc( '\n', stderr );exit( 1 );
  207. #endif
  208. #ifndef YY_@_WRAP
  209. #define YY_@_WRAP yy_wrap
  210. #endif
  211. #ifdef YY_@_WRAP_PURE
  212. #define YY_@_WRAP_NOCODE
  213. #endif
  214. #ifndef YY_@_WRAP_CODE
  215. #define YY_@_WRAP_CODE return 1;
  216. #endif
  217.  
  218.  
  219. #ifndef YY_@_INHERIT
  220. #define YY_@_INHERIT
  221. #endif
  222. #ifndef YY_@_MEMBERS
  223. #define YY_@_MEMBERS 
  224. #endif
  225. #ifndef YY_@_CONSTRUCTOR_PARAM
  226. #define YY_@_CONSTRUCTOR_PARAM
  227. #endif
  228. #ifndef YY_@_CONSTRUCTOR_CODE
  229. #define YY_@_CONSTRUCTOR_CODE
  230. #endif
  231. #ifndef YY_@_CONSTRUCTOR_INIT
  232. #define YY_@_CONSTRUCTOR_INIT
  233. #endif
  234. typedef struct yy_buffer_state *YY_BUFFER_STATE;
  235.  
  236. class YY_@_CLASS YY_@_INHERIT
  237. {
  238.  private:/* data */
  239.  YY_@_CHAR  *yy_c_buf_p;
  240.  YY_@_CHAR  yy_hold_char;
  241.  int yy_n_chars;
  242.  int yy_init;
  243.  int yy_start;
  244.  int yy_did_buffer_switch_on_eof;
  245.  private: /* functions */
  246.  void yy_initialize();
  247.  int input();
  248.  int yyinput() {return input();};
  249.  int yy_get_next_buffer();
  250.  void yyunput( YY_@_CHAR  c, YY_@_CHAR  *buf_ptr );
  251.  /* use long instead of yy_state_type because it is undef */
  252.  long yy_get_previous_state_ ( void );
  253.  long yy_try_NUL_trans_  ( long current_state_ );
  254.  protected:/* non virtual */
  255.  YY_BUFFER_STATE yy_current_buffer;
  256.  void YY_@_RESTART ( FILE *input_file );
  257.  void YY_@_SWITCH_TO_BUFFER( YY_BUFFER_STATE new_buffer );
  258.  void YY_@_LOAD_BUFFER_STATE( void );
  259.  YY_BUFFER_STATE YY_@_CREATE_BUFFER( FILE *file, int size );
  260.  void YY_@_DELETE_BUFFER( YY_BUFFER_STATE b );
  261.  void YY_@_INIT_BUFFER( YY_BUFFER_STATE b, FILE *file );
  262.  protected: /* virtual */
  263.  virtual void YY_@_ECHO()
  264. #ifdef YY_@_ECHO_PURE
  265.   =0
  266. #endif
  267.   ;
  268.  virtual int  YY_@_INPUT(char  *buf,int &result,int max_size)
  269. #ifdef YY_@_INPUT_PURE
  270.   =0
  271. #endif
  272.   ;
  273.  virtual void  YY_@_FATAL_ERROR(char *msg)
  274. #ifdef YY_@_FATAL_ERROR_PURE
  275.   =0
  276. #endif
  277.   ;
  278.  virtual int  YY_@_WRAP()
  279. #ifdef YY_@_WRAP_PURE
  280.   =0
  281. #endif
  282.   ;
  283.  public:
  284.  YY_@_CHAR  *YY_@_TEXT;
  285.  int YY_@_LENG;
  286.  FILE *YY_@_IN, *YY_@_OUT;
  287.  YY_@_LEX_RETURN YY_@_LEX ( YY_@_LEX_PARAM);
  288.  YY_@_CLASS(YY_@_CONSTRUCTOR_PARAM) ;
  289. #if YY_@_DEBUG != 0
  290.  int YY_@_DEBUG_FLAG;
  291. #endif
  292.  public: /* added members */
  293.  YY_@_MEMBERS 
  294. };
  295. #endif
  296.  
  297.  
  298.  
  299. /* declaration of externs for public use of yylex scanner */
  300.  
  301. %% here is the declaration from section2 %header{
  302.  
  303. /* end of generated header */
  304.